package com.jt.vo;

import lombok.Data;

/**
 * @version 创建时间：2021/8/5 23:47
 * @author： Colin
 */
@Data
public class SysResult {
    private Integer status;
    private String msg;
    private Object data;

    public SysResult() {
    }

    public SysResult(Integer status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public static SysResult fail(){
        return new SysResult(201,"失败",null);
    }
    public static SysResult succeed(Object data){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(200);
        sysResult.setMsg("成功");
        sysResult.setData(data);
        return sysResult;
    }
    public static SysResult succeed(){
        SysResult sysResult = new SysResult();
        sysResult.setStatus(200);
        sysResult.setMsg("成功");
        sysResult.setData(null);
        return sysResult;
    }
}
